import { createRouter, createWebHistory } from '@ionic/vue-router';
import { RouteRecordRaw } from 'vue-router';
//import LoginPage from '../views/LoginPage.vue'
import TabsPage from '../views/TabsPage.vue'
//import SystemPopup from '@/views/SystemPopup.vue';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name:'eventlist',
    redirect: '/tabs/eventlist'
  },
  // {
  //   path: '/',
  //   name:'Login',
  //   component:LoginPage
  // },
    
  // {
  //   path: '/',
  //   redirect:'/SystemPopup'
  // },

  // {
  //   path: '/',
  //   redirect:'/MinePage'
  // },
  
  {
    path: '/popupwindow/:triggerName',
    name:'popupwindow',
    component: () =>import('@/views/PopupWindow.vue')
  },
  {
    path: '/systempopup',
    name:'systempopup',
    component: () =>import('@/views/SystemPopup.vue')
  },
  {
    path: '/eventdetails/:triggerName',
    name:'eventdetails',
    component: () => import('@/views/EventDetails.vue'),
    props: true
  },
  {
    path: '/notice-circular/:triggerName',
    name:'notice-circular',
    component: () =>import('@/views/Notice-Circular.vue'),
    props: true
  },
  {
    path: '/contentpage/:id',
    name:'contentpage',
    component: () =>import('@/views/ContentPage.vue'),
    props: true
  },
  // {
  //   path: '/noticedetails',
  //   name:'noticedetails',
  //   component: () => import('@/views/NoticeDetails.vue')
  // },
  {
      path: '/validatepage/',
      name:'validatepage',
      component: () => import('@/views/ValidatePage.vue'),
    },
  {
    path: '/tabs/',
    component: TabsPage,
    children: [
      {
        path: '',
        redirect: '/tabs/eventlist'
      },
      {
        path: 'eventlist',
        component: () => import('@/views/EventList.vue'),
      },
      // {
      //   path: 'noticelist',
      //   component: () => import('@/views/NoticeList.vue')
      // },
      {
        path: 'dutypage',
        component: () => import('@/views/DutyPage.vue')
      },
      {
        path: 'minepage',
        component: () => import('@/views/MinePage.vue')
      },
    ]
  }
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
})

export default router
